Advertisement
Guest User

Untitled

a guest
May 10th, 2023
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. o<1000> sub (Begin subroutine)
  2.  
  3. ; Set probe radius
  4. #<_probe_radius> = 0.9975
  5.  
  6. ; Probe Y-axis edge (back edge of stock- farthest away from operator)
  7. G38.2 Y-10 F100
  8. G91 G0 Y3 (Retract Y-axis a bit)
  9. G38.2 Y-10 F100
  10. #<_y_probed> = #5062 (Store probed Y position)
  11.  
  12. ; Retract the probe and move to the back-left corner
  13. G91 G0 Y5
  14. G0 X-10
  15. G0 Y-10
  16.  
  17. ; Probe the left edge along X-axis (left side of stock)
  18. G38.2 X10 F100
  19. G91 G0 X-1 (Retract X-axis a bit)
  20. G38.2 X10 F100
  21. #<_x_probed> = #5061 (Store probed X position)
  22.  
  23. ; Set the work origin at the back-left corner, accounting for the probe radius
  24. G92 X[#<_x_probed> - #<_probe_radius>] Y[#<_y_probed> + #<_probe_radius>]
  25.  
  26. ; Move back to Z home
  27. G0 Z0
  28. ; Return the tool to the newly set work origin
  29. G0 X0 Y0
  30.  
  31. o<1000> endsub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement